package com.yinhd.study.CompletableFutureStudy;

import java.util.StringJoiner;

/**
 * @program: study
 * @description:
 * @Author: chengl
 * @create: 2022-01-18 10:41
 **/
public class SmallTool {
    public static void sleepMillis(Long millis){
        try {
            Thread.sleep(millis);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }

    public static void printTimeAndThread(String tag){
        String result = new StringJoiner("\t|\t").add(String.valueOf(System.currentTimeMillis()))
                .add(String.valueOf(Thread.currentThread().getId()))
                .add(Thread.currentThread().getName())
                .add(tag)
                .toString();
        System.out.println(result);
    }
}
